/* GUI CONVERTED from ectypeiq.p (converter v1.76) Tue Dec 31 10:45:24 2002 */
/* ectypeiq.p - PCR/PCO APPROVAL CODE INQUIRY                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.6.1.5 $                                                     */
/*V8:ConvertMode=Report                                                 */
/* REVISION: 7.4      LAST EDIT: 11/29/93   MODIFIED BY: QZL *H013*     */
/* REVISION: 8.6      LAST EDIT: 06/12/96   MODIFIED BY: Mariya Kutwal *K00C**/
/* REVISION: 8.6      LAST EDIT: 03/25/97   MODIFIED BY: John Worden   *K08T**/
/* REVISION: 8.6      LAST EDIT: 02/12/98   MODIFIED BY: Beena Mol     *K1H0**/
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00   BY: *N0KW* Jacolyn Neder      */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.6.1.5 $    BY: Katie Hilbert         DATE: 12/27/02  ECO: *P0L8*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* Change references to ect_mstr to pct_mstr */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}

define new shared variable type like ecl_type.
define variable ecttype  like ect_type.
define variable dsgngrp  like ect_dsgn_grp.
define variable ectappr  like ect_approval.
define variable ectdistr like ect_distr.
type = "30".


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   ecttype
   dsgngrp
   ectappr
   ectdistr
with frame a attr-space width 80 THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

FORM /*GUI*/ 
   pct_type
   pct_dsgn_grp
   pct_desc
   pct_doc_type     no-label format "x(3)"
   pct_prefix
   pct_approval     column-label "Apr Code"
   pct_distr        column-label "Dist Grp"
   pct_mod_date
with STREAM-IO /*GUI*/  frame b down width 80.

/* SET EXTERNAL LABELS */
setFrameLabels(frame b:handle).

view frame a.
view frame b.

{wbrp01.i}

loop-a:
repeat with frame a on endkey undo, leave:

   if c-application-mode <> 'web' then
      update ecttype dsgngrp ectappr ectdistr
   editing:

      if frame-field = "ecttype" then do:
         {mfnp.i pct_mstr ecttype pct_type ecttype pct_type pct_type}
         if recno <> ? then display pct_type @ ecttype.
      end.
      else if frame-field = "dsgngrp" then do:
         /* FIND NEXT/PREVIOUS RECORD */
         {mfnp05.i pcl_mstr pcl_group "true" pcl_group "input dsgngrp"}
         if recno <> ? then display pcl_group @ dsgngrp.
      end.
      else do:
         readkey.
         apply lastkey.
      end.
   end.

   {wbrp06.i &command = update &fields = "  ecttype dsgngrp ectappr
        ectdistr" &frm = "a"}

   /* OUTPUT DESTINATION SELECTION */
   {gpselout.i &printType = "terminal"
               &printWidth = 80
               &pagedFlag = " "
               &stream = " "
               &appendToFile = " "
               &streamedOutputToTerminal = " "
               &withBatchOption = "no"
               &displayStatementType = 1
               &withCancelMessage = "yes"
               &pageBottomMargin = 6
               &withEmail = "yes"
               &withWinprint = "yes"
               &defineVariables = "yes"}

   clear frame b all no-pause.

   for each pct_mstr no-lock
      where (pct_type >= ecttype    or ecttype  = "") and
            (pct_dsgn_grp = dsgngrp or dsgngrp  = "") and
            (pct_approval = ectappr or ectappr  = "") and
            (pct_distr = ectdistr   or ectdistr = "")
      with frame b:
      display
         pct_type
         pct_dsgn_grp
         pct_desc
         pct_doc_type
         pct_prefix
         pct_approval
         pct_distr
         pct_mod_date WITH STREAM-IO /*GUI*/ .
      down with frame b.
   end.
   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {pxmsg.i &MSGNUM=8 &ERRORLEVEL=1}
end.
{wbrp04.i &frame-spec = a}
